home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
program
/
swagg_m.zip
/
KEYBOARD.SWG
/
0040_Sound with Keys.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-08-27
|
640b
|
40 lines
{
TOM MOORE
> In a PASCAL-Program I want to execute a Procedure every time the
> user presses a key... Fairly easy, right ? But here comes the
> problem : I want to Repeat that Procedure Until he RELEASES that
> key...
}
Uses
Crt;
Const
Done : Boolean = False;
Var
Ch : Char;
Procedure MakeSound;
begin
if Port[$60] < $80 then
begin
Sound(220);
Delay(100);
end;
if port[$60] > $80 then
NoSound;
end;
begin
Repeat
Repeat
{ While waiting For KeyPressed }
Until KeyPressed;
ch := ReadKey;
if ch = #27 then halt;
makeSound;
Until Done;
end.